class Owner < ActiveRecord::Base
  has_many :items
  def inhaber=(text)
      base = Base64.b64encode(Digest::SHA1.digest("z5_#{text}v!?"))
      cont = Base64.b64encode(Digest::SHA1.digest("ihihwer_#{Time.now.utc}%&/(!?"))
      self.checker=base
      write_attribute(:inhaber, "#{base[1..20].gsub(/\+/, '_')}#{cont[1..12].gsub(/\+/, 'f')}")
     
  end
  def checker=(text)
      base = Base64.b64encode(Digest::SHA1.digest("aprh#{text}--"))
      self.gast=base
      write_attribute(:checker, base[2..17].gsub(/\+/, 'v'))
  end
  def gast=(text)
      base = Base64.b64encode(Digest::SHA1.digest("izt#{text}--"))
      write_attribute(:gast, base[3..10].gsub(/\+/, 'z'))
      
  end
end
